package com.taxinfo.view;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ConfigReader {
    public static void main(String[] args) {
        String jarPath = System.getProperty("java.class.path");
        String jarDirectory = new File(jarPath).getParent();
        String configFilePath = jarDirectory + File.separator + "config.properties";

        Properties properties = new Properties();
        try (InputStream inputStream = new FileInputStream(configFilePath)) {
            properties.load(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }

        String databaseUrl = properties.getProperty("database.url");
        System.out.println("Database URL: " + databaseUrl);
    }
}